Save a result for this flow
5 minute read Beginner
Save a result for this flow:
It means storing the output or outcome of a specific flow run. This is useful for tracking user responses or decisions.
How to Create a Save Flow Result in Glific:
-
Add a New Step
:- In your flow, add a new node after collecting user input.
-
Select "Save Flow Result"
:- Choose the Save Flow Result option from the dropdown.
-
Configure the Result
:-
Result
: Enter a unique name (e.g., user_rating). -
Value
: Use an expression like @(input) to save the user's response. -
Category
(Optional): Add a category like Rating.
-
-
Save
andContinue
:- Click
OK
to save the configuration and proceed with the next step in your flow.
- Click
This step allows you to store specific data when a contact reaches a particular point in a flow.
-
Result
:- Enter a unique name for the result, which you can reference later using
@results
. - You can either select an existing result or create a new one.
- Enter a unique name for the result, which you can reference later using
-
Value
:- Specify the value to be saved for the result.
- You can use expressions to dynamically set the value, like @(title(input)).
- Leaving this blank clears any previous value.
-
Category
(Optional):- Use this to categorize the result, e.g., if the value is 17, the category might be Young Adult.
Example 1
:
- If a flow collects a user's feedback rating as "4", you can save the result as feedback_rating with the value 4.
You can then use
@results.feedback_rating
in subsequent steps to reference this value.
You want to collect user satisfaction ratings (1 to 5) after a support interaction.
Flow Steps:
-
Ask for Feedback:
- Send a message: "How would you rate your experience with us on a scale of 1 to 5?"
-
Capture User Input:
- Use a "Wait for Response" to collect the rating.
-
Save the Result:
- Use the "Save Flow Result" with the following configuration:
- Result: user_rating
- Value: @(input) (to capture the response)
- Category: Rating (optional)
-
Acknowledge:
- Send a thank-you message: "Thank you for your feedback! Your rating of @results.user_rating is noted."
How It Works: - When the user responds with a number (e.g., "4"), it gets saved as user_rating with a value of 4. - You can use @results.user_rating later in the flow for analysis or follow-up.
Example 2
:
- Want to gather registration details, including preferred sessions and dietary preferences.
Flow Steps:
-
Welcome Message:
- Send a message: "Welcome to our upcoming virtual event! Let’s get you registered. Could you share your name?"
-
Capture Name:
- Use Wait for Response to get the user’s name.
-
Save the Name:
- Use Save Flow Result with the following configuration:
- Result: user_name
- Value: @(input)
- Category: Registration
-
Ask for Session Choice:
- Send a message:
- Which session are you most interested in? Options: Tech Innovations, Social Impact, Career Growth.
- Use Wait for Response to capture the choice.
-
Save the Session Choice:
- Use Save Flow Result with the following configuration:
- Result: session_preference
- Value: @(input)
- Category: Event Details
-
Dietary Preferences (for On-site Attendees)- Check Attendance Type:
- Send a message: Will you be attending virtually or on-site?
- Use Wait for Response to get the answer.
-
Save Attendance Type:
- Use Save Flow Result with the following configuration:
- Result: attendance_type
- Value: @(input)
- Category: Event Details
-
Conditional Question:
- If @results.attendance_type is "On-site", proceed to Step 9.
- If "Virtual", skip to Step 11.
-
On-site Specific Information- Ask for Dietary Preference:
- Send a message: Please let us know your dietary preference: Vegetarian, Non-Vegetarian, Vegan.
- Use Wait for Response to collect the preference.
-
Save Dietary Preference:
- Use Save Flow Result with the following configuration:
- Result: dietary_preference
- Value: @(input)
- Category: Event Details
-
Send a personalized message:
- "Thank you,
@results.user_name
! You are registered for the event. You have chosen the @results.session_preference session and will be attending @results.attendance_type. @if(@results.attendance_type == 'On-site') Your dietary preference is @results.dietary_preference."
- "Thank you,
How It Works:
-
This flow dynamically adapts to whether the user is attending virtually or on-site.
-
The data collected can be used to send personalized event reminders and follow-up messages, making the experience more tailored and efficient.